<?php

$_language->read_module('demos');

//Options:
$list = 2; //1 = top 5 demos , 2 = latest 5 demos

//dont edit above this line
if($list==1) $list="rating"; else $list="date";

$ergebnis=safe_query("SELECT * FROM ".PREFIX."demos ORDER BY $list DESC LIMIT 0,5");
$n=1;
if(mysql_num_rows($ergebnis)){
	echo'<table width="100%" cellspacing="0" cellpadding="2">';
	while($ds=mysql_fetch_array($ergebnis)) {
		$demoID = $ds['demoID'];
		$count = $ds['downloads'];
		$clan1 = $ds['clan1'];
		$tag1 = $ds['clantag1'];
		$tag2 = $ds['clantag2'];
		$clan2 = $ds['clan2'];
		$number = $n;
    
    if($n%2) {
			$bg1=BG_1;
			$bg2=BG_2;
		}
		else {
			$bg1=BG_3;
			$bg2=BG_4;
		}
	
		eval("\$sc_demos = \"".gettemplate("sc_demos")."\";");
		echo $sc_demos;
	
		$n++;
	}
	echo'</table>';
}	
?>
